package com.eascs.workflow.wf.controller;

import javax.inject.Inject;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.web.sso.UserHolder;
import com.eascs.workflow.wf.form.MoveTemplateNodeForm;
import com.eascs.workflow.wf.service.ProcessNodeTemplateService;

@RestController
public class TemplateRestController extends BaseRestController {

	@Inject
	private ProcessNodeTemplateService ProcessNodeTemplateService;

	@RequestMapping(value = "/wf/node-template/move", method = RequestMethod.GET)
	public BaseRestResult<String> moveTemplateNode(MoveTemplateNodeForm moveTemplateNodeForm) {
		ProcessNodeTemplateService.moveTemplateNode(moveTemplateNodeForm.getNodeId(), moveTemplateNodeForm.getOpt(), UserHolder.getUser().getCode());
		return BaseRestResult.refresh();
	}
}
